# {{ ansible_managed }}
#--------------------------------------------------------
# This file must contain only ISO 8859-1 characters
# see http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html#load(java.io.InputStream)
#
# To use an environment variable, use the following syntax :  ${env:NAME_OF_ENV_VARIABLE}
# For example :
#   sonar.jdbc.url: ${env:SONAR_JDBC_URL}
#
#
# See also the file conf/wrapper.conf for JVM advanced settings
#---------------------------------------------------------


#---------------------------------------------------------
# WEB SETTINGS - STANDALONE MODE ONLY
# These settings are ignored when the war file is deployed to a JEE server.
#---------------------------------------------------------
# Listen host/port and context path (for example / or /sonar). Default values are 0.0.0.0:9000/.
sonar.web.host:                           {{sonar_listen_ip}}
sonar.web.port:                           {{sonar_port}}
#sonar.web.context:                        /

# Log HTTP requests. Deactivated by default.
#sonar.web.jettyRequestLogs: ../../logs/jetty-yyyy_mm_dd.request.log
#sonar.web.jetty.threads.min:              5
#sonar.web.jetty.threads.max:              50

#-----------------------------------------------------------------------
# DATABASE
#
# IMPORTANT : the embedded database H2 is used by default.
# It is recommended for tests only. Please use an external database
# for production environment (MySQL, Oracle, Postgresql, SQLServer)
#
#-----------------------------------------------------------------------

#----- Credentials
# Permissions to create tables and indexes must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username:                       {{sonar_jdbc_user}}
sonar.jdbc.password:                       {{sonar_jdbc_pass}}

#----- Embedded database H2
# Note : it does not accept connections from remote hosts, so the
# SonarQube server and the maven plugin must be executed on the same host.

# Comment the following line to deactivate the default embedded database.
{% if sonar_jdbc_driver == "h2" %}  
sonar.jdbc.url:                            jdbc:h2:tcp://{{sonar_jdbc_host}}:{{sonar_jdbc_port}}/{{sonar_jdbc_db}}
{% else %}
#sonar.jdbc.url:                            jdbc:h2:tcp://localhost:9092/sonar
{% endif %}
# directory containing H2 database files. By default it's the /data directory in the SonarQube installation.
#sonar.embeddedDatabase.dataDir:
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port:               9092


#----- MySQL 5.x
# Comment the embedded database and uncomment the following line to use MySQL

{% if sonar_jdbc_driver == "mysql" %}  
sonar.jdbc.url:                            jdbc:mysql://{{sonar_jdbc_host}}:{{sonar_jdbc_port}}/{{sonar_jdbc_db}}?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
{% else %}
#sonar.jdbc.url:                            jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
{% endif %}




#----- Oracle 10g/11g
# To connect to Oracle database :
#
# - It's recommended to use the latest version of the JDBC driver (ojdbc6.jar).
#   Download it in http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html
# - Copy the driver to the directory extensions/jdbc-driver/oracle/
# - Comment the embedded database and uncomment the following line :
#sonar.jdbc.url:                            jdbc:oracle:thin:@localhost/XE


# Uncomment the following property if the Oracle account has permissions to access multiple schemas,
# for example sonar schemas with different versions. In that case, use the same property during project analysis
# (-Dsonar.jdbc.schema=<schema>)
# The schema is case-sensitive.
#sonar.jdbc.schema:                         sonar


#----- PostgreSQL 8.x/9.x
# Comment the embedded database and uncomment the following property to use PostgreSQL
{% if sonar_jdbc_driver == "postgresql" %}  
sonar.jdbc.url:                            jdbc:postgresql://{{sonar_jdbc_host}}:{{sonar_jdbc_port}}/{{sonar_jdbc_db}}
{% else %}
#sonar.jdbc.url:                            jdbc:postgresql://localhost/sonar
{% endif %}

# Uncomment the following property if the PostgreSQL account has permissions to access multiple schemas,
# for example sonar schemas with different versions. In that case, use the same property during project analysis
# (-Dsonar.jdbc.schema=<schema>)
{% if sonar_jdbc_driver == "postgresql" and sonar_psq_schema is defined %}  
sonar.jdbc.schema:                        {{sonar_psq_schema}}
{% else %}
#sonar.jdbc.schema:                         public
{% endif %}

#----- Microsoft SQLServer
# The Jtds open source driver is available in extensions/jdbc-driver/mssql. More details on http://jtds.sourceforge.net
#sonar.jdbc.url:                            jdbc:jtds:sqlserver://localhost/sonar;SelectMethod=Cursor


#----- Connection pool settings
sonar.jdbc.maxActive:                      {{sonar_jdbc_maxActive}}
sonar.jdbc.maxIdle:                        {{sonar_jdbc_maxIdle}}
sonar.jdbc.minIdle:                        {{sonar_jdbc_minIdle}}
sonar.jdbc.maxWait:                        {{sonar_jdbc_maxWait}}
sonar.jdbc.minEvictableIdleTimeMillis:     {{sonar_jdbc_minEvictableIdleTimeMillis}}
sonar.jdbc.timeBetweenEvictionRunsMillis:  {{sonar_jdbc_timeBetweenEvictionRunsMillis}}


#---------------------------------------------------------
# UPDATE CENTER
#---------------------------------------------------------

# The Update Center requires an internet connection to request http://update.sonarsource.org
# It is activated by default:
#sonar.updatecenter.activate=true

# HTTP proxy (default none)
#http.proxyHost=
#http.proxyPort=

# NT domain name if NTLM proxy is used
#http.auth.ntlm.domain=

# SOCKS proxy (default none)
#socksProxyHost=
#socksProxyPort=

# proxy authentication. The 2 following properties are used for HTTP and SOCKS proxies.
#http.proxyUser=
#http.proxyPassword=

#---------------------------------------------------------
# NOTIFICATIONS
#---------------------------------------------------------

# Delay (in seconds) between processing of notification queue
sonar.notifications.delay=60
